package com.flex.showdoc4j.filter;

import com.alibaba.fastjson.serializer.PropertyFilter;

import java.util.Arrays;

/**
 * 提交参数过滤
 * @author ganlt<br>
 * @since 2019/06/27 17:02 <br>
 */
public class PageParamFilter implements PropertyFilter {
    private static final String[] RESERVE_FIELDS_NAME = {"current","size"};
    @Override
    public boolean apply(Object object, String name, Object value) {
        boolean isExists = Arrays.stream(RESERVE_FIELDS_NAME).anyMatch(val->val.equals(name));
        if (isExists) {
            return true;
        }
        return false;
    }
}
